package com.wx.wrapper;

/**
 * @Author : 佩萁
 * Description :
 * @Create : 2023/7/10 - 16:23
 */
public class WrapperExercise02 {
    public static void main(String[] args) {
        Integer i = new Integer(1);
        Integer j = new Integer(1);
        System.out.println(i == j);//false 因为new了两个对象，==比较对象的地址不一样

        Integer m = 1;
        Integer n = 1;//底层是Integer.valueOf()
        System.out.println(m == n);//true

        Integer x = 128;//底层 Integer.valueOf(1);
        Integer y = 128;//底层 Integer.valueOf(1);
        System.out.println(x == y);//False

        Integer i9 = 127; //Integer.valueOf(127)
        Integer i10 = new Integer(127);
        System.out.println(i9 == i10);//F

        Integer i11 = 127;
        int i12 = 127;
        System.out.println(i11 == i12);
    }
}
